package com.study.base.concurrent;

import java.util.concurrent.locks.ReentrantLock;

/**
 * Description:
 * User: 27010
 * DateTime: 2018/3/8 14:16
 */
public class ReentrantLockTest {
    public static void main(String[] args) throws InterruptedException {
        ReentrantLock lock = new ReentrantLock(true);

        Thread thread = new Thread(() -> {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            lock.lock();
            lock.unlock();
        });

        thread.start();


        lock.lock();
        Thread.sleep(10000000);
        lock.unlock();


    }
}
